/********************************** (C) COPYRIGHT *******************************
 * File Name          : CH394Q_SPI.h
 * Author             : WCH
 * Version            : V1.0.1
 * Date               : 2024/12/09
 * Description        : CH394Q SPI header file
 *******************************************************************************/
#ifndef CH394Q_SPI_H_
#define CH394Q_SPI_H_

#include "stdint-gcc.h"

#define SPI_MODE      1
#define SPI_DMA_MODE  0

// #define SPICH394QStart() (GPIOA->BRR = GPIO_PIN_4)
// #define SPIEndCH394Q() (GPIOA->BSRR = GPIO_PIN_4)


void     CH394Q_Write(uint32_t addr,uint8_t data);
uint8_t  CH394Q_Read(uint32_t addr);
uint16_t CH394Q_WriteBuf(uint32_t addr,uint8_t* buf,uint16_t len);
uint16_t CH394Q_ReadBuf(uint32_t addr, uint8_t* buf,uint16_t len);

#endif
